package com.hzhr.iot.device.convertor.custom;

import com.hzhr.iot.device.convertor.ImplRecordConvertor;
import com.hzhr.iot.device.entity.ext.*;
import com.hzhr.iot.device.model.implRecord.ImplRecordModel;
import org.springframework.stereotype.Service;

@Service
public class ImplRecordCustomConvertor extends ImplRecordConvertor {

    @Override
    public ImplRecordModel ext2implRecordModel(ImplRecordEntityExt in) {
        ImplRecordModel result = super.ext2implRecordModel(in);
        CollectDeviceEntityExt ext1 = in.getCollectDeviceExt();
        if (ext1 != null) {
            result.setCollectDeviceDes(ext1.getDes());
            result.setCollectDeviceCategoryCode(ext1.getCategoryCode());
            result.setCollectDeviceTypeId(ext1.getTypeId());
            CollectDeviceTypeEntityExt ext2 = ext1.getTypeExt();
            if (ext2 != null) {
            }
        }

        IotDeviceEntityExt ext3 = in.getIotDeviceExt();
        if (ext3 != null) {
            result.setIotDeviceDes(ext3.getDes());
            result.setIotDeviceCategoryCode(ext3.getCategoryCode());
            result.setIotDeviceSimTypeCode(ext3.getSimTypeCode());
            result.setIotDeviceSimNo(ext3.getSimNo());
            result.setIotDeviceTypeId(ext3.getTypeId());
            OptionsEntityExt ext4 = ext3.getSimTypeExt();
            if (ext4 != null) {
                result.setIotDeviceSimTypeDes(ext4.getName());
            }
            IotDeviceTypeEntityExt ext5 = ext3.getTypeExt();
            if (ext5 != null) {
            }
        }

        OptionsEntityExt ext6 = in.getCommStatusExt();
        if (ext6 != null) {
            result.setCommStatusDes(ext6.getDes());
        }

        OptionsEntityExt ext7 = in.getRunStatusExt();
        if (ext7 != null) {
            result.setRunStatusDes(ext7.getDes());
        }

        OptionsEntityExt ext8 = in.getFixStatusExt();
        if (ext8 != null) {
            result.setFixStatusDes(ext8.getDes());
        }

        ImplIotDeviceTypeEntityExt ext9 = in.getIotDeviceTypeExt();
        if (ext9 != null) {
            result.setIotDeviceTypeDes(ext9.getDes());
        }

        ImplFactoryEntityExt ext10 = in.getProdFactoryExt();
        if (ext10 != null) {
            result.setProdFactoryDes(ext10.getDes());
        }

        OptionsEntityExt ext11 = in.getSimTypeExt();
        if (ext11 != null) {
            result.setSimTypeDes(ext11.getDes());
        }

        OptionsEntityExt ext12 = in.getManagedMeterInfoExt();
        if (ext12 != null) {
            result.setManagedMeterInfoDes(ext12.getDes());
        }

        ImplFactoryEntityExt ext13 = in.getInstallFacotoryExt();
        if (ext13 != null) {
            result.setInstallFacotoryDes(ext13.getDes());
        }

        return result;
    }
}

